package tests;

import static org.junit.Assert.*;

import java.io.IOException;

import org.eclipse.ui.examples.javaeditor.java.JavaCodeScanner;
import org.eclipse.ui.examples.javaeditor.util.JavaColorProvider;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class ColorTest {
	
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}


	@Test
	public void testOrnage() throws IOException {
		JavaCodeScanner.changeColorVariable("TestingColor", "Orange");
		assertTrue(JavaCodeScanner.vOrange == "TestingColor");
	}
	
	@Test
	public void testBrown() throws IOException {
		JavaCodeScanner.changeColorVariable("TestingColor", "Brown");
		assertTrue(JavaCodeScanner.vBrown == "TestingColor");
	}
	
	@Test
	public void testCyan() throws IOException {
		JavaCodeScanner.changeColorVariable("TestingColor", "Cyan");
		assertTrue(JavaCodeScanner.vCyan == "TestingColor");
	}
	
	@Test
	public void testPink() throws IOException {
		JavaCodeScanner.changeColorVariable("TestingColor", "Pink");
		assertTrue(JavaCodeScanner.vPink == "TestingColor");
	}
	
	@Test
	public void testPurple() throws IOException {
		JavaCodeScanner.changeColorVariable("TestingColor", "Purple");
		assertTrue(JavaCodeScanner.vPurple == "TestingColor");
	}
	
	@Test
	public void testEmpty() throws IOException {
		JavaCodeScanner.changeColorVariable("", "Orange");
		assertTrue(JavaCodeScanner.vOrange == "");
	}
	
	@Test
	public void testAssginTwice() throws IOException {
		JavaCodeScanner.changeColorVariable("First Orange", "Orange");
		JavaCodeScanner.changeColorVariable("Second Orange", "Orange");
		assertTrue(JavaCodeScanner.vOrange == "Second Orange");
	}
	
	@Test
	public void testRepeatedString() throws IOException {
		JavaCodeScanner.changeColorVariable("Same String", "Orange");
		JavaCodeScanner.changeColorVariable("Same String", "Pink");
		assertTrue((JavaCodeScanner.vOrange == "Same String") && (JavaCodeScanner.vPink == "Same String") );
	}
	
	
	
}
